// Tags: Possibility
#include <cstdio>
#include <cstring>

const int N = 100;
int n, tot[26];
char str[N];
double f[N], a[N][N];

int main() {
#ifndef ONLINE_JUDGE
#ifdef LOCAL
  freopen("testdata.in", "r", stdin);
  freopen("testdata.out", "w", stdout);
#else
  freopen("P5516 [MtOI2019]小铃的烦恼.in", "r", stdin);
  freopen("P5516 [MtOI2019]小铃的烦恼.out", "w", stdout);
#endif
#endif

  scanf("%s", str + 1);
  n = strlen(str + 1);
  for (int i = 1; i <= n; ++i) tot[str[i] - 'A']++;
  a[1][1] = 1, a[1][2] = 
  for (int i = 2; i <= n; ++i) {
    a[i][i - 1] = (i - 1) / i / 2.0;
    a[i][i + 1] = (i + 1) / i / 2.0;
  }
  double ans = 0;
  for (int i = 0; i < 26; ++i) ans += f[tot[i]] * tot[i] / n;
  printf("%.1lf", ans);
  return 0;
}